package com.itheima.controller;

import com.itheima.exception.BusinessException;
import com.itheima.exception.SystemException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class ProjectExceptionAdvice {
        @ExceptionHandler(BusinessException.class)
        public Result doSystemException(BusinessException e){

            return new Result(e.getCode(),e.getMessage());
        }
}
